package pers.zc.activiti.thread.zhalan;

import java.util.concurrent.CyclicBarrier;

/**
 * @description 栅栏demo
 * @Author Lin FuYuan
 * @date 2020/4/24
 */
public class CyclicBarrierDemo {


    public static void main(String[] args) {
        CyclicBarrier cyclicBarrier = new CyclicBarrier(7, () -> {
            System.out.println("====召唤神龙");
        });

        for (int i = 1; i <= 7; i++) {
           new Thread(new RunnableDemo(cyclicBarrier,i)).start();
        }

    }
}
